package com.yxx.controller.user;

import com.yxx.medicinecommon.result.ResponseResult;
import com.yxx.medicinepojo.entity.Medicine_Category;
import com.yxx.service.MedicineCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yuxiangxun
 * @date 2024/9/23
 * @apiNote
 */
@RestController("userMedicineCategoryController")
@Slf4j
@Api(tags = "小程序端  分类接口")
@RequestMapping("/user/medicinecategory")
public class MedicineCategoryController {
    @Autowired
    private MedicineCategoryService medicineCategoryService;

    /**
     * 根据分类类型查询药品和组合药分类
     * @param type
     * @return
     */
    @GetMapping("/list")
    @ApiOperation("中/西药分类列表")
    public ResponseResult<List<Medicine_Category>> MedicineCategoryList(Integer type){
        List<Medicine_Category> list = medicineCategoryService.list(type);
        return ResponseResult.success(list);
    }
}
